﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using AhCha.Fortunate.Common.Extensions;

using Microsoft.AspNetCore.Http;

namespace AhCha.Fortunate.Common.Utility
{
    public class Oops
    {

        /// <summary>
        /// 抛出业务异常信息
        /// </summary>
        /// <param name="errorMessage">异常消息</param>
        /// <returns>异常实例</returns>
        public static FortunateException Bah(string errorMessage)
        {
            var friendlyException = Oh(errorMessage);
            friendlyException.ValidationException = true;
            return friendlyException;
        }

        /// <summary>
        /// 抛出字符串异常
        /// </summary>
        /// <param name="errorMessage">异常消息</param>
        /// <returns>异常实例</returns>
        public static FortunateException Oh(string errorMessage)
        {
            var friendlyException = new FortunateException(errorMessage, default);
            return friendlyException;
        }


    }
}
